<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
<script>
	//更新排序
	function update_weixin_sort(){
		var data=new Array();
		$("input[name='id']").each(function(index, element) {
            data.push($(this).val()+'_'+$(this).parent().parent().find("input[name='weixin_sort']").val());
        });
		$.post("{:U('doweixin_sort')}",{'sort':data.toString()},function(data){
			if(data=='OK'){
				alert('更新成功');
			}
		});
	}
</script>
  <div class="w790">
    <h1><a href="{:U('add',array('type' =>$type, 'position' => $position))}" title="添加数据" class="addbtn">添加导航</a></h1>
    <form action="" method="get" id="sform">
    导航类型：
    <select onchange="document.getElementById('sform').submit();" name="type" id="type">
            <option <eq name="type" value="pc">selected="selected"</eq> value="pc">PC端网站</option>
            <option <eq name="type" value="mobile">selected="selected"</eq> value="mobile">手机端网站</option>
            <option <eq name="type" value="weixin">selected="selected"</eq> value="weixin">微信网站</option>
          </select>
   
导航位置：
<select onchange="document.getElementById('sform').submit();" name="position" id="position">
          <option <eq name="position" value="top">selected="selected"</eq> value="top">顶部</option>
          <option <eq name="position" value="bottom">selected="selected"</eq> value="bottom">底部</option>
          <option <eq name="position" value="left">selected="selected"</eq> value="left">左边</option>
          <option <eq name="position" value="right">selected="selected"</eq> value="right">右边</option>
          <option <eq name="position" value="main">selected="selected"</eq> value="main">主导航(微信)</option>
        </select>
    </form>
<div class="table_"><table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
 <tr>
    <td height="21" align="center">ID</td>
    <td align="center">导航名称</td>
    <td align="center">链接</td>
    <td align="center">导航名称(英文)</td>
    <td align="center">状态</td>
  
    

    <td align="center">排序</td>
    <td align="center">操作</td>
  </tr>
</thead>
<volist name="list" id="vo">
  <tr class="data_list">
    <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$vo.id}" /></td>
    <td style="text-indent:{$vo['cl']*10}px"><gt name="vo['cl']" value="0">|-</gt>{$vo.title}</td>
    <td>{$vo.link}</td>
    <td>{$vo.name}</td>
    <td align="center"><eq name="vo['status']" value="1"><span class="status1 status_btn" field="status,{$vo.id}"></span><else/><span class="status0 status_btn" field="status,{$vo.id}"></span></eq></td>
    
    
    
    <td align="center"><input name="sort" width="30" type="text" value="{$vo.sort}" size="4" /><a href="javascript:void(0);" onclick="update_sortClick('id','up',this,'sort','{:U('dosort')}');">上</a><a href="javascript:void(0);" onclick="update_sortClick('id','',this,'sort','{:U('dosort')}');">下</a></td>
    <td align="center"><a href="{:U('edit',array('id'=>$vo['id'],'type' =>$type, 'position' => $position))}" title="编辑" class="editbtn">编辑</a> | <a href="{:U('delete',array('id'=>$vo['id']))}" onclick="return confirm('您确定要删除这条记录吗？');" class="delbtn" title="删除">删除</a></td>
  </tr>


       <volist name="vo['sub']" id="svo">
       	<tr class="data_list">
          <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$svo.id}" /></td>
          <td style="text-indent:{$svo['deep']*20}px"><gt name="svo['deep']" value="0">|-</gt>{$svo.title}</td>
          <td>{$svo.link}</td>
          <td>{$svo.name}</td>
    <td align="center"><eq name="svo['status']" value="1"><span class="status1 status_btn" field="status,{$svo.id}"></span><else/><span class="status0 status_btn" field="status,{$svo.id}"></span></eq></td>
   
    
   
          <td align="center"><input name="sort" width="30" type="text" value="{$svo.sort}" size="4" /><a href="javascript:void(0);" onclick="update_sortClick('id','up',this,'sort','{:U('dosort')}');">上</a><a href="javascript:void(0);" onclick="update_sortClick('id','',this,'sort','{:U('dosort')}');">下</a></td>
          <td align="center"><a href="{:U('edit',array('id'=>$svo['id'],'type' =>$type, 'position' => $position))}" class="editbtn">编辑</a> | <a href="{:U('delete',array('id'=>$svo['id']))}" onclick="return confirm('您确定要删除这条记录吗？');" class="delbtn">删除</a></td>
        </tr>
       </volist>
</volist>
  
</table></div>
<div class="pages">
      <div class="controlList fl"><a href="javascript:void(0);" onclick="sall();">全选/反选</a> <a href="javascript:void(0);" onclick="rall();">全不选</a> <a href="javascript:void(0);" onclick="delall();">删除选中</a> <a href="javascript:void(0);" onclick="update_sort('id','sort','','{:U('dosort')}');">更新排序</a>  <a href="javascript:void(0);" onclick="update_weixin_sort();">更新排序(微信)</a></div>
        <form class="fr" style="display:inline;" id="pagesize" action="" method="get">
          每页
          <select name="pagesize" onchange="document.getElementById('pagesize').submit();">
            <option 
            <eq name="pagesize" value="10">selected="selected"</eq>
             value="10">10
            </option>
            <option 
            <eq name="pagesize" value="20">selected="selected"</eq>
             value="20">20
            </option>
            <option 
            <eq name="pagesize" value="30">selected="selected"</eq>
             value="30">30
            </option>
            <option 
            <eq name="pagesize" value="50">selected="selected"</eq>
             value="50">50
            </option>
            <option 
            <eq name="pagesize" value="100">selected="selected"</eq>
             value="100">100
            </option>
            <option 
            <eq name="pagesize" value="500">selected="selected"</eq>
             value="500">500
            </option>
          </select>
          条
          <input type="hidden" name="category_id" value="{$category_id}" />
          <input type="hidden" name="keywords" value="{$keywords}" />
        </form>
        <div class="fr">{$pages}</div>
    </div>
  </div>
  <div class="clear"></div>
</div>
</body></html>